//
//  AboutController.swift
//  flowerpot
//
//  Created by fyname on 15/11/13.
//  Copyright © 2015年 senhe. All rights reserved.
//

import UIKit

class AboutController: UIViewController {

    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        
        // 自定义返回按钮
        let backButton = UIBarButtonItem(title: "く返回", style: UIBarButtonItemStyle.Plain, target: self, action: "goBack")
        self.navigationItem.leftBarButtonItem = backButton
        
        // 弥补因为返回按钮被替换导致的边缘滑入手势失效的问题
        let gesture = UIPanGestureRecognizer(target: self, action: "goBack")
        self.view.addGestureRecognizer(gesture)
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    func goBack() {
//        self.navigationController?.popViewControllerAnimated(true)
//        Common.rootViewController.mainTabBarController.tabBar.hidden = false
        print("about")
        Common.rootViewController.mainTabBarController.view.addSubview(Common.indexVC.view)
        Common.rootViewController.mainTabBarController.view.bringSubviewToFront(Common.rootViewController.mainTabBarController.tabBar)
    }
    
}
